package com.itheima.homework02;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        System.out.println("————————————————————————————客户端启动————————————————————-");

        Socket socket = new Socket("127.0.0.1",6666);
        DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
        dos.writeUTF("在吗，约不约！");
        dos.flush();
        socket.shutdownOutput();


        //上传完毕，接收服务器的反馈信息
        DataInputStream dis = new DataInputStream(socket.getInputStream());
        String data = dis.readUTF();
        System.out.println(data);
        socket.close();


    }
}
